﻿-- =========================================================================================================
-- Author:		MICHAEL RITACCO
-- Copyright:	2010 MEKHANO GROUP LLC
-- Version:		08/21/2010 1.0
-- =========================================================================================================
CREATE PROCEDURE [flcr].[api_device_category_device_xref_dml_del]
	 (@DEVICE_CAT_DEVICE_XREF_UDT AS FLCR.DEVICE_CAT_DEVICE_XREF_UDT READONLY)
AS
BEGIN TRY
	BEGIN TRAN;
	
	DELETE	[FLCR].[DEVICE_CATEGORY_DEVICE_XREF] 
	 WHERE	[DEVICE_CATEGORY_DEVICE_XREF_ID] IN (SELECT DEVICE_CAT_DEVICE_XREF_ID FROM @DEVICE_CAT_DEVICE_XREF_UDT) 

	DELETE	[FLCRTM].[DEVICE_CATEGORY_DEVICE_XREF] 
	 WHERE	[DEVICE_CAT_DEVICE_XREF_ID] IN (SELECT DEVICE_CAT_DEVICE_XREF_ID FROM @DEVICE_CAT_DEVICE_XREF_UDT)

	COMMIT TRAN;

END TRY
BEGIN CATCH
	ROLLBACK TRANSACTION;
	EXEC [FLCR].[UTL_GETDBERROR];
END CATCH
